import axios from './axios'

//获取厂商信息
export function getManufacturer(params = { limit: 99999 }) {
  return axios({
    url: '/manufacturer/manufacturer',
    params
  })
}

export function postManufacturer(params) {
  return axios({
    method: 'put',
    url: '/manufacturer/manufacturer',
    // url: 'updateManufacturer',
    params
  })
}

//新增条码建档
export function postBarCode(params) {
  return axios({
    method: 'post',
    url: '/branded-company-barcode/brandedCompanyBarcode',
    params
  })
}

//查询条码规律 品牌公司 （条码规律控制层
// ）
export function getBarCode(params = {}) {
  return axios({
    url: '/branded-company-barcode/brandedCompanyBarcode',
    params
  })
}

export function deleteManufacturer(params) {
  return axios({
    method: 'delete',
    url: '/manufacturer/manufacturer',
    params
  })
}
export function putManufacturer(data) {
  return axios({
    method: 'post',
    // url: '/manufacturer/manufacturer',
    url: '/manufacturer/updateManufacturer',
    data
  })
}
//修改条码建档
// export function putBarCode(params){
//   return axios({
//     method:'put',
//     url:'/branded-company-barcode/brandedCompanyBarcode',
//     params
//   })
// }
//删除条码建档
export function deleteBarCode(params) {
  return axios({
    method: 'delete',
    url: '/branded-company-barcode/brandedCompanyBarcode',
    params
  })
}

// 根据序号查询对应的rfid对象
// 类型:1:厂进 2:厂退 3.仓库调拨 4.仓库盘差
export function sequenceRfidList(params) {
  return axios({
    url: '/manufacturer-input-total/sequenceRfidList',
    params
  })
}

// 厂进读卡
export function factoryInput(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-input-total/factoryInput',
    data
  })
}

// 新增
export function importFactoryInput(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-input-total/importFactoryInput',
    data
  })
}

// 厂进确认
// updateType 确认传1  收货传2
export function affirmRfidInput(params) {
  return axios({
    method: 'put',
    url: '/manufacturer-input-total/affirmRfidInput',
    params
  })
}

// 厂商进货减标
export function subtract(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-input-total/subtract',
    data
  })
}

// 厂商进货清空
export function removeRfidInput(params) {
  return axios({
    method: 'delete',
    url: '/manufacturer-input-total/removeRfidInput',
    params
  })
}

// 厂商进货修改
export function factoryModification(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-input-total/FactoryModification',
    data
  })
}

// 厂进获取前五条进货订单信息
export function inputSequenceQuery(params) {
  return axios({
    url: '/manufacturer-input-total/inputSequenceQuery',
    params
  })
}

// 根据输入框字符串获取货号数据
export function searchKindsNumber(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-input-total/searchKindsNumber',
    data
  })
}

//根据输入框字符串获取货号数据 RFID
export function factoryInputScanner(params) {
  return axios({
    url: '/manufacturer-input-total/factoryInputScanner',
    params
  })
}

// 新建时厂价编辑修改
export function updateMP(params) {
  return axios({
    method: 'put',
    url: '/manufacturer-input-total/updateManufacturerPrice',
    params
  })
}

// 新建时厂价编辑修改
export function updateMPR(params) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/updateManufacturerPrice',
    params
  })
}

// 厂进查询按钮
// 未修改参数直接查询isDefault为true
// 日期默认为一周前到今天
export function inputQuery(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-input-total/inputQuery',
    data
  })
}

// 厂商进货查询根据序号查询
export function inputQueryDetail(params) {
  return axios({
    url: '/manufacturer-input-total/inputQueryDetail',
    params
  })
}

// 厂商进货查询改单
export function modifySequence(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-input-total/modifySequence',
    data
  })
}

// 厂商进货删单
export function removeOrderInput(data) {
  return axios({
    method: 'delete',
    url: '/manufacturer-input-total/removeOrder',
    data
  })
}

// 清除单号缓存数据     关闭页面时调用
export function clearSequence(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-input-total/clearSequence',
    data
  })
}

//导入
export function postExcel(data) {
  return axios({
    method: 'post',
    url: '/manufacturer/importManufacturer',
    data
  })
}

// 厂退读卡/新建保存
// 读卡时isNewBox：false，新建保存isNewBox：true
export function factoryOut(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-out-total/factoryOut',
    data
  })
}

// 厂商 导入
export function importFactoryOut(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-out-total/importFactoryOut',
    data
  })
}

// 厂商退货减标
export function factoryOutSubtract(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/subtract',
    data
  })
}

// 厂退退货清空
export function removeRfidOutPut(params) {
  return axios({
    method: 'delete',
    url: '/manufacturer-out-total/removeRfidOutPut',
    params
  })
}

// 厂商退货修改
export function factoryOutModification(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/FactoryModification',
    data
  })
}

// 厂退获取前五条退货订单信息
export function outSequenceQuery(params) {
  return axios({
    url: '/manufacturer-out-total/inputSequenceQuery',
    params
  })
}

// 厂商退货存退
export function retreat(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-out-total/retreat',
    data
  })
}

// 厂商退货更新虚拟库存
// 200库存够，201库存不够
export function renewRepertory(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/renewRepertory',
    data
  })
}

// 厂商退货确认
export function affirmRfidOut(params) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/affirmRfidOut',
    params
  })
}

// 厂退查询按钮
export function outQuery(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-out-total/outQuery',
    data
  })
}

// 厂商退货查询根据序号查询
export function outQueryDetail(params) {
  return axios({
    url: '/manufacturer-out-total/outQueryDetail',
    params
  })
}

// 厂退查询改单
export function outModifySequence(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/modifySequence',
    data
  })
}

// 厂商退货删单
export function removeOrderOut(data) {
  return axios({
    method: 'delete',
    url: '/manufacturer-out-total/removeOrder',
    data
  })
}

// 厂商销售查询
export function manufacturerSell(params) {
  return axios({
    url: '/sellTotal/manufacturerSell',
    params
  })
}

//厂商进销比
export function getInOut(params) {
  return axios({
    url: '/input-out-save-repertory-one/factoryPin',
    params
  })
}

//厂商销售比详情
export function factoryPinDetail(params) {
  return axios({
    url: '/input-out-save-repertory-one/factoryPinDetail',
    params
  })
}

// 厂商应付对账单查询按钮
export function manufacturerPaymentQuery(data) {
  return axios({
    method: 'post',
    url: '/manufacturer-payment/manufacturerPaymentQuery',
    data
  })
}

//根据厂商查货号
export function getANumber(data) {
  return axios({
    url: '/kinds-number/kindsNumber',
    data
  })
}

//获取型号
export function getModel(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/quarterListQuery',
    data
  })
}

export function getQuarterNum(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/quarterListQuery',
    data
  })
}

// /kinds-number/Qaceehrrsuy / 搜索框搜索货号数组
// 货号控制层
// （下面不是我注释）
//仓库盘差 扫描条码
export function getScanning(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/searchQuery',
    data
  })
}

//仓库调拨 新建保存
export function AddWarehouse(data) {
  return axios({
    method: 'post',
    url: '/warehouse-allot-total/cardReader',
    data
  })
}

//仓库盘差明细查询
export function getDetailed(data) {
  return axios({
    method: 'post',
    url: '/warehouse-differ/warehouseInventoryQuery',
    data
  })
}

//仓库调拨改单保存
export function putWarehouse(data) {
  return axios({
    method: 'put',
    url: '/warehouse-allot-total/warehouseAllotUpdateOrder',
    data
  })
}

//仓库调拨查询
export function getWarehouseTab(data) {
  return axios({
    method: 'put',
    url: '/warehouse-allot-total/warehouseAllotQuery',
    data
  })
}
//仓库调拨确认
export function confirmWarehouse(params) {
  return axios({
    method: 'put',
    url: '/warehouse-allot-total/warehouseAllotAffirm',
    params
  })
}
//仓库调拨读卡
export function readRfid(data) {
  return axios({
    method: 'post',
    url: '/warehouse-allot-total/cardReader',
    data
  })
}
//调拨删单
export function DeleteOd(data) {
  return axios({
    method: 'delete',
    url: '/warehouse-allot-total/removeOrder',
    data
  })
}
//调拨减标
export function reduaceRfid(data) {
  return axios({
    method: 'put',
    url: '/warehouse-allot-total/subtract',
    data
  })
}
//调拨清空
export function clearBoth(params) {
  return axios({
    method: 'delete',
    url: '/warehouse-allot-total/removeWarehouseAllotQuery',
    params
  })
}

//仓库盘点新建/补单
export function InventoryNewBuild(data) {
  return axios({
    method: 'post',
    url: '/warehouse-check/warehouseCheck',
    data
  })
}
//仓库盘点查询
export function InventoryQuary(params) {
  return axios({
    url: '/warehouse-check/warehouseCheckQuery',
    params
  })
}
//盘点查询 差量查询
export function getDifference(data) {
  return axios({
    method: 'post',
    url: '/warehouse-check/differenceQuery',
    data
  })
}
//盘点查询密码验证
export function testPwd(params) {
  return axios({
    url: '/login/checkPassword',
    params
  })
}

//仓库盘点改单
export function InventoryChange(data) {
  return axios({
    method: 'put',
    url: '/warehouse-check/modify',
    data
  })
}
//仓库盘点确认
export function confirmInventory(params) {
  return axios({
    method: 'put',
    url: '/warehouse-check/affirm',
    params
  })
}
//盘点删除
export function DeleteOrder(data) {
  return axios({
    method: 'delete',
    url: '/warehouse-check/removeOrder',
    data
  })
}
//盘点清空
export function Empty(params) {
  return axios({
    method: 'delete',
    url: '/warehouse-check/cleanWarehouseCheck',
    params
  })
}
//盘点自动盘差
export function Automatic(data) {
  return axios({
    method: 'post',
    url: '/warehouse-check/autoDiffer',
    data
  })
}
//盘点减标/warehouse-check/subtract
export function Reduace(data) {
  return axios({
    method: 'put',
    url: '/warehouse-check/subtract',
    data
  })
}

//盘差查询删单
export function DeleteDishdifference(data) {
  return axios({
    method: 'delete',
    url: '/warehouse-differ/removeOrder',
    data
  })
}
//盘点查询删单
export function DeleteTackStock(data) {
  return axios({
    method: 'delete',
    url: '/warehouse-check/removeOrder',
    data
  })
}
//调拨查询删单
export function DeleteTransfers(data) {
  return axios({
    method: 'delete',
    url: '/warehouse-allot-total/removeOrder',
    data
  })
}
//调拨 序号查rfid
export function getXHRfid(params) {
  return axios({
    url: '/warehouse-allot-total/sequenceQueryRfids',
    params
  })
}
//盘点查询 rfid 删单

export function getPdRfid(params) {
  return axios({
    url: '/warehouse-check/rfidList',
    params
  })
}

//调拨 根据货号查货号详细
export function getKind(params) {
  return axios({
    url: '/kinds-number/listByKindsNumber',
    params
  })
}

// 厂家对账
export function factoryBill(params) {
  return axios({
    url: '/manufacturer-input-total/factoryBill',
    params
  })
}

// 款号明细记录
export function getStyleNumberInfo(params) {
  return axios({
    url: '/manufacturer-input-total/getStyleNumberInfo',
    params
  })
}
